﻿
using System;
using System.Collections.Generic;
using Microsoft.VisualStudio;
using Microsoft.VisualStudio.TextManager.Interop;
using Microsoft.VisualStudio.Package;
using Babel;
using dragonangel.phpProject.Language.DSL.Parser;

namespace dragonangel.phpProject.Language
{
    public class AuthoringScope : Babel.AuthoringScope
    {
        public AuthoringScope(object parseResult, AuthoringSink sink,IList<Tokens> expectedTokens)
            : base(parseResult)
        {
            this.resolver = new Resolver(expectedTokens);
            this.sink = sink;
        }

        private AuthoringSink sink;

        // ParseReason.CompleteWord
        // ParseReason.DisplayMemberList
        // ParseReason.MemberSelect
        // ParseReason.MemberSelectAndHilightBraces
        public override Microsoft.VisualStudio.Package.Declarations GetDeclarations(IVsTextView view, int line, int col, TokenInfo info, ParseReason reason)
        {
            ((Resolver)resolver).View = view;
            ((Resolver)resolver).Sink = sink;
            return base.GetDeclarations(view, line, col, info, reason);
        }
    }
}